/*
 * $Id$
 */
package py.windmill.resolution;

import py.windmill.action.MimeType;
import py.windmill.action.Request;
import py.windmill.action.Response;
import py.windmill.action.Resolution;
import py.windmill.action.ValidationErrors;

/**
 *
 * @author myang
 */
public class HTML extends ResolutionSupport {

    public HTML() {
        this("utf-8");
    }

    public HTML(final String charset) {
        super(MimeType.HTML.attr("charset", charset));
    }

    @Override
    public void execute(final Request req, final Object val) {
        req.response().println(val);
    }

    @Override
    public boolean isAcceptedBy(final Request req) {
        return super.isAcceptedBy(req) || req.accepts(MimeType.ALL) != -1;
    }
}
